import { createRouter, createWebHistory } from 'vue-router'

import IndexView from '@/views/Index/index.vue';
import DistributionView from '@/views/AqiDistribution/index.vue';
import TrendView from '@/views/AqiTrend/index.vue';
import ConfirmView from '@/views/ConfirmAqi/index.vue';
import LayoutView from '@/views/layout/index.vue';
import OtherView from '@/views/OtherStats/index.vue';
import ProvView from '@/views/ProvGroupStat/index.vue';
import PublicView from '@/views/PublicSupervision/index.vue';
import LoginView from '@/views/login/index.vue';
import DetailView from '@/views/PublicSupervisionDetail/index.vue';
import GridWorkerView from '@/views/GridWorkerAssignment/index.vue';
import AqiDetailView from '@/views/AqiDetail/index.vue';
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name:'', 
      component: LayoutView,
      redirect: 'index',
      children: [
        {path: 'index', name: 'index', component: IndexView},
        {path: 'AqiDistribution', name: 'AqiDistribution', component: DistributionView},
        {path: 'AqiTrend', name: 'AqiTrend', component: TrendView},
        {path: 'ConfirmAqi', name: 'ConfirmAqi', component: ConfirmView},
        {path: 'OtherStats', name: 'OtherStats', component: OtherView},
        {path: 'ProvGroupStat', name: 'ProvGroupStat', component: ProvView},
        {path: 'PublicSupervision', name: 'PublicSupervision', component: PublicView},
        {path: 'PublicSupervisionDetail', name: 'PublicSupervisionDetail', component: DetailView},
        {path: 'GridWorkerAssignment', name: 'GridWorkerAssignment', component: GridWorkerView},
        {path: 'AqiDetail', name: 'AqiDetail', component: AqiDetailView}
      ]
    },
    {
      path: '/login',name: 'login',component: LoginView
    }
  ]
})

export default router
